package cn.com.dhcc.app.pub.core.util.settlement.compute.task;

import cn.com.dhcc.app.pub.core.util.settlement.compute.store.DataProcessHandler;

import java.util.Date;
import java.util.concurrent.Callable;


/**
 * 数据合并任务--当接收适配器成功接收
 * @author Administrator
 *
 */
public class DataMergeTask implements Callable<Boolean>{

	/**
	 * 一次请求id
	 */
	private String orderId;
	
	/**
	 * 对应的任务id
	 */
	private String taskId;
	private Date date;//数据交换日期
	private DataProcessHandler processHandler;
	
	
	public DataMergeTask(String orderId,String taskId,Date date,DataProcessHandler processHandler) {
		super();
		this.orderId = orderId;
		this.taskId = taskId;
		this.date = date;
		this.processHandler=processHandler;
	}



	@Override
	public Boolean call() throws Exception {
		try {
			System.out.println("["+orderId+"]数据合并开始...");
			processHandler.merge(orderId, taskId,date);
			System.out.println("["+orderId+"]数据合并结束...");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return true;
	}
}
